/*
 * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[欢迎加盟知启蒙，一起邂逅框架梦]
 * 
 * https://www.zhiqim.com/gitcan/zhiqim/zhiqim_account.htm
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.zhiqim.account;

import org.zhiqim.kernel.util.seqs.IntSequence;

/**
 * 常量定义
 *
 * @version v1.0.0 @author zouzhigang 2018-3-26 新建与整理
 */
public interface ZacConstants
{
    public static final String ZAC_NAME                     = "zhiqim.account";
    
    /************************************************************************************/
    //账号类型&用户注册来源，本站手机&本站邮箱&QQ&微信开放平台&微信公众号
    /************************************************************************************/
    
    public static final int ACCOUNT_TYPE_USERNAME           = 90;
    public static final int ACCOUNT_TYPE_MOBILE             = 100;
    public static final int ACCOUNT_TYPE_EMAIL              = 110;
    public static final int ACCOUNT_TYPE_QQ                 = 200;
    public static final int ACCOUNT_TYPE_WXOP               = 210;
    public static final int ACCOUNT_TYPE_WXMP               = 220;
    
    /************************************************************************************/
    //QQ互联参数配置
    /************************************************************************************/
    
    public static final String QQ_URL_AUTH                  = "https://graph.qq.com/oauth2.0/authorize?client_id={0}&redirect_uri={1}&state={2}&response_type=code&scope=get_user_info,list_album,upload_pic,do_like";
    public static final String QQ_URL_TOKEN                 = "https://graph.qq.com/oauth2.0/token?client_id={0}&client_secret={1}&redirect_uri={2}&code={3}&grant_type=authorization_code";
    public static final String QQ_URL_ME                    = "https://graph.qq.com/oauth2.0/me?access_token={0}";
    public static final String QQ_URL_GET_USER_INFO         = "https://graph.qq.com/user/get_user_info?oauth_consumer_key={0}&access_token={1}&openid={2}&format=json";
    
    public static final String QQ_APP_ID                    = "qqconnect.appId";
    public static final String QQ_APP_SECRET                = "qqconnect.appSecret";
    public static final String QQ_CALLBACK                  = "qqconnect.callback";
    
    public static final String QQ_CONF_ERR                  = "系统未配置QQ互联的[appId]或[appSecret]或[callback]信息，请联系管理员在后台系统参数中配置";
    
    /************************************************************************************/
    //微信开放平台互联参数配置
    /************************************************************************************/
    
    public static final String WXOP_URL_AUTH                = "https://open.weixin.qq.com/connect/qrconnect?appid={0}&redirect_uri={1}&state={2}&response_type=code&scope=snsapi_login";
    public static final String WXOP_URL_TOKEN               = "https://api.weixin.qq.com/sns/oauth2/access_token?appid={0}&secret={1}&code={2}&grant_type=authorization_code";
    public static final String WXOP_URL_GET_USER_INFO       = "https://api.weixin.qq.com/sns/userinfo?access_token={0}&openid={1}";
    
    public static final String WXOP_APP_ID                  = "wxop.appId";
    public static final String WXOP_APP_SECRET              = "wxop.appSecret";
    public static final String WXOP_CALLBACK                = "wxop.callback";
    
    public static final String WXOP_CONF_ERR                = "系统未配置微信开放平台的[appId]或[appSecret]或[callback]信息，请联系管理员在后台系统参数中配置";
    
    /************************************************************************************/
    //微信公众号互联参数配置
    /************************************************************************************/
    
    public static final String WXMP_URL_AUTH                = "https://open.weixin.qq.com/connect/oauth2/authorize?appid={0}&redirect_uri={1}&state={2}&response_type=code&scope=snsapi_userinfo#wechat_redirect";
    
    public static final String WXMP_APP_ID                  = "wxmp.appId";
    public static final String WXMP_APP_SECRET              = "wxmp.appSecret";
    public static final String WXMP_CALLBACK                = "wxmp.callback";
    
    public static final String WXMP_CONF_ERR                = "系统未配置微信公从号的[appId]或[appSecret]或[callback]信息，请联系管理员在后台系统参数中配置";
    
    public static final String WXMP_CUSTOMER                = "wxmp.customer";
    /************************************************************************************/
    //支付状态&类型
    /************************************************************************************/
    
    public static final IntSequence PAY_SEQ                 = new IntSequence(1, 9999);
    public static final IntSequence REF_SEQ                 = new IntSequence(1, 9999);
    
    //交易类型
    public static final String CHARGE                       = "CHARGE";//充值
    public static final String REFUND                       = "REFUND";//退款
    public static final String CONSUM                       = "CONSUM";//消费
    
    //交易状态
    public static final String TRADE_WAITING                = "TRADE_WAITING";//交易等待付款
    public static final String TRADE_EAMOUNT                = "TRADE_EAMOUNT";//交易错误金额
    public static final String TRADE_FAILURE                = "TRADE_FAILURE";//交易支付失败
    public static final String TRADE_SUCCESS                = "TRADE_SUCCESS";//交易支付成功
    
    //退款状态
    public static final String REFUND_WAITING               = "REFUND_WAITING";//退款等待
    public static final String REFUND_FAILURE               = "REFUND_FAILURE";//退款失败
    public static final String REFUND_SUCCESS               = "REFUND_SUCCESS";//退款成功
    public static final String REFUND_EXCEPTN               = "REFUND_EXCEPTN";//交易结束，不可退款
    
    /************************************************************************************/
    //微信支付类型
    /************************************************************************************/
    
    public static final String WXPAY_UNIFIEDORDER_URL       = "https://api.mch.weixin.qq.com/pay/unifiedorder"; //统一下单URL
    public static final String WXPAY_ORDERQUERY_URL         = "https://api.mch.weixin.qq.com/pay/orderquery";   //订单查询URL
    public static final String WXPAY_CLOSEORDER_URL         = "https://api.mch.weixin.qq.com/pay/closeorder";
    
    public static final String WXPAY_MICROPAY_URL           = "https://api.mch.weixin.qq.com/pay/micropay";
    public static final String WXPAY_REVERSE_URL            = "https://api.mch.weixin.qq.com/secapi/pay/reverse";
    public static final String WXPAY_REFUND_URL             = "https://api.mch.weixin.qq.com/secapi/pay/refund";
    public static final String WXPAY_REFUNDQUERY_URL        = "https://api.mch.weixin.qq.com/pay/refundquery";
    public static final String WXPAY_DOWNLOADBILL_URL       = "https://api.mch.weixin.qq.com/pay/downloadbill";
    public static final String WXPAY_REPORT_URL             = "https://api.mch.weixin.qq.com/payitil/report";
    public static final String WXPAY_SHORTURL_URL           = "https://api.mch.weixin.qq.com/tools/shorturl";
    public static final String WXPAY_AUTHCODETOOPENID_URL   = "https://api.mch.weixin.qq.com/tools/authcodetoopenid";

    
    public static final String WXPAY_NATIVE                 = "NATIVE";     //扫码支付
    public static final String WXPAY_MWEB                   = "MWEB";       //H5支付
    public static final String WXPAY_JSAPI                  = "JSAPI";      //公众号支付
    
    public static final String WXPAY_SUCCESS                = "SUCCESS";
    public static final String WXPAY_FIELD_SIGN             = "sign";
    
    /************************************************************************************/
    //支付宝常量
    /************************************************************************************/
    
    public static final String ALIPAY_API_URL                  = "https://openapi.alipay.com/gateway.do";
    
}
